package Homework3;

interface Ia {
    int max(int[] a);
}

interface Ib {
    int min(int[] a);
}

public class Test2 implements Ia, Ib {
    @Override
    public int min(int[] a) {
        int minNum = a[0];
        for (int i: a)
        {
            if (i < minNum)
            {
                minNum = i;
            }            
        }
        return minNum;
    }

    @Override
    public int max(int[] a) {
        int maxNum = a[0];
        for (int i: a)
        {
            if (i > maxNum)
            {
                maxNum = i;
            }            
        }
        return maxNum;
    }
    
    public static void main(String[] args) {
        Test2 test = new Test2();
        int[] score = {88,89,82,90,98};
        int maxScore = test.max(score);
        int minScore = test.min(score);

        System.out.println("max score is " + maxScore);
        System.out.println("min score is " + minScore);
    }
}
